package personal.xjl._23java1studentdemo.spring;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("niuCarBean")
@Data
public class NiuCar {
    @Value("3")  //@Value只适合普通数据类型
    int wheelnum;
    @Autowired
    @Qualifier("niuBean")
    List<Niu> nius;

    public void run() {
        System.out.println("牛车开始前进！");
    }
}
